package com.huangguolin.cloud.login.entity;

import com.huangguolin.cloud.mybatis.entity.PtMenuEntity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;


/**
 * 菜单分级
 */
public class MenuLevelEntity implements Serializable {

    public MenuLevelEntity(PtMenuEntity ptMenuEntity){
        this.menuIcon = ptMenuEntity.getMenuIcon();
        this.menuId = ptMenuEntity.getMenuId();
        this.menuName = ptMenuEntity.getMenuName();
        this.menuUrl = ptMenuEntity.getMenuUrl();
        this.parentId = ptMenuEntity.getParentId();
    }

    private List<MenuLevelEntity> children = new ArrayList<>();
    /**
     * 菜单编码
     */
    private String menuId;
    /**
     *菜单名称
     */
    private String menuName;
    /**
     *夫菜单id
     */
    private String parentId;
    /**
     *菜单url
     */
    private String menuUrl;
    /**
     *菜单图标类名
     */
    private String menuIcon;

    public List<MenuLevelEntity> getChildren() {
        return children;
    }

    public void setChildren(List<MenuLevelEntity> children) {
        this.children = children;
    }

    public void addChildren(MenuLevelEntity item) {
        this.children.add(item);
    }

    public String getMenuId() {
        return menuId;
    }

    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getMenuUrl() {
        return menuUrl;
    }

    public void setMenuUrl(String menuUrl) {
        this.menuUrl = menuUrl;
    }

    public String getMenuIcon() {
        return menuIcon;
    }

    public void setMenuIcon(String menuIcon) {
        this.menuIcon = menuIcon;
    }

    @Override
    public String toString() {
        return "MenuLevelEntity{" +
                "children=" + children +
                ", menuId='" + menuId + '\'' +
                ", menuName='" + menuName + '\'' +
                ", parentId='" + parentId + '\'' +
                ", menuUrl='" + menuUrl + '\'' +
                ", menuIcon='" + menuIcon + '\'' +
                '}';
    }
}
